<template>
    <basic-container>
        <div style="width: 70%;">
            <el-form :model="ruleForm"  ref="ruleForm" label-width="160px" class="demo-ruleForm">
                <el-form-item label="支付宝开关" prop="payWaySwitchZfb">
                    <el-switch v-model="ruleForm.payWaySwitchZfb"
                               active-color="#13ce66"
                               inactive-color="#ff4949"
                               active-value="true"
                               inactive-value='fasle'></el-switch>
                </el-form-item>
                <el-form-item label="微信支付开关" prop="payWaySwitchWx">
                    <el-switch v-model="ruleForm.payWaySwitchWx"
                               active-color="#13ce66"
                               inactive-color="#ff4949"
                               active-value="true"
                               inactive-value='fasle'></el-switch>
                </el-form-item>
<!--                <el-form-item label="银联支付开关" prop="payWaySwitchYl">-->
<!--                    <el-switch v-model="ruleForm.payWaySwitchYl"-->
<!--                               active-color="#13ce66"-->
<!--                               inactive-color="#ff4949"-->
<!--                               active-value="true"-->
<!--                               inactive-value="fasle"></el-switch>-->
<!--                </el-form-item>-->
                <!--正式环境需要也把"余额支付开关"给去掉-->
<!--                <el-form-item label="余额支付开关" prop="payWaySwitchYe">-->
<!--                    <el-switch v-model="ruleForm.payWaySwitchYe"-->
<!--                               active-color="#13ce66"-->
<!--                               inactive-color="#ff4949"-->
<!--                               active-value="true"-->
<!--                               inactive-value="fasle"></el-switch>-->
<!--                </el-form-item>-->

                <el-form-item label="ES搜索开关" prop="syncSwitch">
                    <el-switch v-model="ruleForm.syncSwitch"
                               active-color="#13ce66"
                               inactive-color="#ff4949"
                               active-value="true"
                               inactive-value="fasle"></el-switch>
                </el-form-item>

<!--                <el-form-item label="自动审核配货单" prop="autoAuditOrderDistributionSwitch">-->
<!--                    <el-switch v-model="ruleForm.autoAuditOrderDistributionSwitch"-->
<!--                               active-color="#13ce66"-->
<!--                               inactive-color="#ff4949"-->
<!--                               active-value="true"-->
<!--                               inactive-value="false"></el-switch>-->
<!--                </el-form-item>-->
<!--                <el-form-item label="是否开启退款审核" prop="orderRefundSwitch">-->
<!--                    <el-switch v-model="ruleForm.orderRefundSwitch"-->
<!--                               active-color="#13ce66"-->
<!--                               inactive-color="#ff4949"-->
<!--                               active-value="true"-->
<!--                               inactive-value="fasle"></el-switch>-->
<!--                </el-form-item>-->
                <el-form-item label="手机推送id" prop="ntificationId">
                    <el-input v-model="ruleForm.ntificationId" placeholder="请输入内容"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm()" size="medium"><i class="el-icon-check"></i> 提交</el-button>
                </el-form-item>
            </el-form>
        </div>
    </basic-container>
</template>
<script>
    import {
        getBase,
        setBase
    } from '@/api/base/sysSet/baseSet'
    export default {
        data() {
            return {
                ruleForm: {
                    payWaySwitchZfb:'',
                    payWaySwitchWx:'',
                    payWaySwitchYl:'',
                    payWaySwitchYe:'',
                    integralStore:'',
                    autoAuditOrderDistributionSwitch:'',
                    orderRefundSwitch:'',
                    ntificationId:'',
                    syncSwitch:'',
                },
            };
        },
        created(){
            this.getData()

        },
        methods: {
            //获取数据
            getData(){
                getBase().then(res=>{
                    if(res.data.code==200){
                        this.ruleForm=res.data.data
                    }
                })
            },
            submitForm() {
                setBase(this.ruleForm).then(res=>{
                    if(res.data.code==200){
                        this.$message({
                            message:'提交成功',
                            type:'success'
                        })
                        this.getData()
                    }
                })
            },
        }
    }
</script>